<?php
session_start();
if (isset($_GET) && $_GET['act']=='add')
{
	$id=$_GET['prid'];
	if (isset($_SESSION['cart'][$id]))
	{
	 	$qty=$_SESSION['cart'][$id]+1;
	}
	else $qty=1;
	$_SESSION['cart'][$id]=$qty;
	header ('location:../ShoppingCart/Cart.php');
	exit();
}
if ( isset($_GET) && $_GET['act']=='delete')
{
			session_start();
		$cart=$_SESSION['cart'];
		$id=$_GET['prid'];
		if($id == 0)
		{
			unset($_SESSION['cart']);
		}
		else
		{
		unset($_SESSION['cart'][$id]);
		}
	
	header ('location:../ShoppingCart/Cart.php');
	exit();
}
 ?>
  	